<template>
  <div class="login">
    <div class="loginBox">
      <button @click="alertMessage"> 点击</button>
    </div>

  </div>
</template>
<script>
  import {mapState} from 'vuex'

  export default {
    data() {
      return {}
    },
    methods: {
      alertMessage() {
        this.$http.get('').then(res => {
          console.log(res)
        })
      },
      handleSubmit(name) {
        this.$refs[name].validate((valid) => {
          if (valid) {
            console.log(this.formInline)
            this.$store.commit('tooken', JSON.stringify(this.formInline))
            this.$router.push('./index')
          } else {
            this.$Message.error('用户名或密码错误!')
          }
        })
      }
    },
    computed: {
      ...mapState([
        'tooken'
      ])
    }
  }
</script>
<style lang='less' scoped>
  .loginBox {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0.5rem auto;
    width: 30%;
    height: 2rem;
    box-sizing: border-box;
    padding: .02rem;
    background-color: #fff;
    border: 1px solid #eee;
  }
</style>
